package com.auction.common.dao.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@ApiModel("分页查询条件")
public class PageParam {

    @ApiModelProperty("当前页，默认为1")
    int page;

    @ApiModelProperty("每页记录数，默认为10")
    int pageSize;

    public int getPage() {
        if (page <= 0)
            return 1;
        return page;
    }

    public void setPage(int page) {
        if (page <= 0)
            this.page = 1;
        this.page = page;
    }

    public int getPageSize() {
        if (pageSize <= 0)
            return 10;
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        if (pageSize <= 0)
            this.pageSize = 10;
        this.pageSize = pageSize;
    }
}
